package com.sf.dlb.web.service;

import com.sf.dlb.utils.DateUtils;

import com.sf.dlb.web.config.Global;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 计划任务service
 * Created by jing.tan on 2018/5/21.
 */
@Service
public class ScheduledTaskService {
    private static Logger logger = LoggerFactory.getLogger(ScheduledTaskService.class);

    @Autowired
    private UserWarningService warningService;
    @Resource
    public Global global;
    /**
     * 每天晚上的定时任务
     */
    @Scheduled(cron = "0 0 1 * * ?")
    public void handlerScheduledTask(){
        logger.info("handlerScheduledTask start time = "+ DateUtils.getDateTime()+" & day="+global.wallet_dlb_unlock_time_day);
        //预警
        warningService.warning("");
        logger.info("handlerScheduledTask start end = "+ DateUtils.getDateTime());
    }
}
